package random;

import java.util.Random;

public class RandomInts {

	public void run(){
		Random r = new Random();
		int max = findMaxGeneratedValue(r, 8);
		System.out.println(max);
		System.out.println(findMaxGeneratedValue(r, 2));
	}
	
	private int findMaxGeneratedValue(Random r, int i) {
		int max = 0;
		for(int j = 0; j < i*100; j++){
			int storage = r.nextInt(i);
			if(storage > max) max = storage;
		}
		return max;
	}

	public static void main(String[] args) {
		RandomInts ri = new RandomInts();
		ri.run();
	}

}
